package com.wisezone.HomeWork.home04;



public class WindowDemo {
    public static void main(String[] args) {
        Window window = new Window();
        //要想启动一个多线程，必须调用start()方法：
        Thread one = new Thread(window);
        one.start();//启动线程，执行Thread对象生成时构造器形参的对象run()方法

        //再创建一个线程
        Thread two = new Thread(window);
        two.start();
    }
}
//多线程实现方法二
 class Window implements Runnable{
    @Override
    public void run() {
        for (int i=1;i<=100;i++){
            if (i%2==0){
                System.out.println(Thread.currentThread().getName()+":"+i);
            }
        }
    }
}

